import { parseArticle } from './parseArticle';

export function Article({ text }: { text: string }) {
  const { title, paragraphs } = parseArticle(text);
  return (
    <div>
      <h2 className='article-title'>{title}</h2>
      {paragraphs.map((p, i) => (
        <p key={i} className='article-paragraph'>
          {p}
        </p>
      ))}
    </div>
  );
}
